package com.zhuang.decorator;

/**
 * @Classname Client
 * @Description  装饰器模式测试类
 * @Date 2021/3/23 21:53
 * @Created by dell
 */

public class Client {
    public static void main(String[] args) {
        //点一份炒饭
        FastFood rice = new FiredRice();
        //价格
        System.out.println(rice.getDesc() + "-->" + rice.cost() + "元");

        System.out.println("=============================");

        //点一份加鸡蛋的炒饭
        FastFood eggRice = new FiredRice();
        //加鸡蛋
        eggRice = new Egg(eggRice);
        System.out.println(eggRice.getDesc() + "-->" + eggRice.cost() + "元");

        System.out.println("=============================");

        //点一份加培根的炒面
        FastFood baconNoodles = new FiredNoodles();
        //加培根
        baconNoodles = new Bacon(baconNoodles);
        System.out.println(baconNoodles.getDesc() + "-->" + baconNoodles.cost() + "元");

    }
}
